package com.tuanzi.loan.web.bean.member;

import com.google.common.collect.Lists;
import com.tuanzi.loan.business.constants.DictionaryCode;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.vo.request.member.LoanMemberOrderRequest;
import com.tuanzi.loan.vo.response.member.LoanMemberOrderResponse;
import com.tuanzi.loan.web.configuration.JSFListingBean;
import com.tuanzi.loan.web.lazy.member.LoanMemberOrderLazyDataModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;
import java.util.List;

/**
 * @Author: chenweijun
 * @Date: 2019/3/29 19:48
 * @Description:
 */
@Data
@Debug
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class LoanMemberOrderListBean extends JSFListingBean<LoanMemberOrderRequest, LoanMemberOrderResponse>{


    @PostConstruct
    private void init(){
        initLazyDataModel();
    }

    private void initLazyDataModel(){
        $ = new LoanMemberOrderRequest();
        lazyDataModel = new LoanMemberOrderLazyDataModel($);
    }

    @Override
    protected List<String> getDictionaryCodes() {
        return Lists.newArrayList(DictionaryCode.LOAN_MEMBER_ORDER_STATUS,
                DictionaryCode.LARGE_COMMON_PRODUCT);
    }
}
